package gare;

import gare.quai.EspaceQuai;
import gare.vente.EspaceVente;

import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;

import billetterie.BilletterieImpl;

public class Gare {

	private EspaceQuai espaceQuai;

	private EspaceVente espaceVente;

	private BilletterieImpl billetterie;

	public Gare() {

		try {

			this.billetterie = (BilletterieImpl) Naming
					.lookup("rmi://localhost:12121/billetterie");
		} catch (NotBoundException e) {
			e.printStackTrace();
		} catch (MalformedURLException e) {
			e.printStackTrace();
		} catch (RemoteException e) {
			e.printStackTrace();
		}
		espaceQuai = new EspaceQuai(this);
		espaceVente = new EspaceVente(this);
	}

	public EspaceQuai getEspaceQuai() {
		return espaceQuai;
	}

	public EspaceVente getEspaceVente() {
		return espaceVente;
	}

	public BilletterieImpl getBilletterie() {
		return billetterie;
	}

}
